package com.pth.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.HibernateTemplate;

import com.pth.dao.HuatiDAO;
import com.pth.model.Huati;

public class HuatiDAOImpl implements HuatiDAO {

	private HibernateTemplate template;
	
	public void save(Huati huati) {

		template.save(huati);
		
	}

	public void delete(Huati huati) {

		template.delete(huati);
		
	}

	public void update(Huati huati) {

		template.update(huati);
		
	}

	public Huati getHuatiByid(int id) {

		
		return template.get(Huati.class, id);
	
	}

	@SuppressWarnings("unchecked")
	public List<Huati> getHuatis() {

		
		return template.find("from Huati");
		
	
	}

	public HibernateTemplate getTemplate() {
		return template;
	}

	public void setTemplate(HibernateTemplate template) {
		this.template = template;
	}

}
